#pragma once

#include <utility/EventHandler.h>
#include <vector>

// ItemTab
namespace serika
{
	namespace dq
	{
		class ItemTabPanel;
		class ItemTabPanelFactory;

		class ItemTab : public CTabCtrl, public ut::EventHandler
		{
			DECLARE_DYNAMIC(ItemTab)

		public:
			ItemTab(bool withAllTab);
			virtual ~ItemTab();

			virtual void Handle(const ut::Event& e);

			void Initialize(ItemTabPanelFactory* factory);
			void Finalize();

			void Activate();
			void Deactivate();

		protected:
			DECLARE_MESSAGE_MAP()
			afx_msg void OnTabChanged(NMHDR* pNMHDR, LRESULT* pResult);

		private:
			ItemTabPanelFactory* mFactory;
			std::vector<ItemTabPanel*> mPanels;
			ItemTabPanel* mActiveWnd;

			bool mWithAllTab;

		private:
			ItemTabPanel* GetPanel(int index);
		};
	}
}



